﻿@model RMSoftware.Models.ProjectRisk
@{
    ViewBag.Title = "Добавить риск";
}
<h2>
    Добавление риска</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<table>
    <tr>
        <td>
            <b>Название</b>
        </td>
        <td>
            <b>Действия</b>
        </td>
    </tr>
    @foreach (RMSoftware.Models.Risk riskFactor in Model.)
    {
        <tr>
            <td>@riskFactor.Title
            </td>
            <td>
                @Html.ActionLink("Удалить", "DeleteRiskFactor", new { id = riskFactor.RiskId })
            </td>
        </tr>
    }
</table>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Новый риск</legend>
        <div class="editor-label" style="display: none">
            @Html.LabelFor(model => model.ProjectId)
        </div>
        <div class="editor-field" style="display: none">
            @Html.EditorFor(model => model.ProjectId)
            @Html.ValidationMessageFor(model => model.ProjectId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.RiskId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.RiskId)
            @Html.ValidationMessageFor(model => model.RiskId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Probability)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Probability)
            @Html.ValidationMessageFor(model => model.Probability)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Cost)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Cost)
            @Html.ValidationMessageFor(model => model.Cost)
        </div>
        <p>
            <input type="submit" value="Создать" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Вернуться к проекту", "Index")
</div>
